package com.hrms.hrms_workflow.service.impl;

import com.hrms.hrms_workflow.constant.FLOW_RESOURCE;
import com.hrms.hrms_workflow.service.workflowService;
import org.flowable.engine.ProcessEngine;
import org.flowable.engine.RuntimeService;
import org.flowable.engine.TaskService;
import org.flowable.engine.repository.Deployment;
import org.springframework.beans.factory.annotation.Autowired;

public class workflowServiceImpl implements workflowService {

    @Autowired
    private ProcessEngine processEngine;

    @Autowired
    private RuntimeService runtimeService;

    @Autowired
    private TaskService taskService;

    @Override
    public void deployflow() {
        Deployment deploy = processEngine.getRepositoryService().createDeployment()
                .addClasspathResource(FLOW_RESOURCE.RECRUIT.getCode()) // 部署一个流程
                .name("流程案例")
                .deploy();
        System.out.println(deploy.getId());


    }

    @Override
    public void startflow() {

    }

    @Override
    public void findflow() {

    }

    @Override
    public void completeflow() {

    }
}
